<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>CAD-Tool: /home/manish/Desktop/Manish_CAD_Tool/src/Full_plane.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CAD-Tool
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Full_plane.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_full__plane_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_full__plane_8h.html">include/Full_plane.h</a>&quot;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="general__methods_8h.html">include/general_methods.h</a>&quot;</span></div><div class="line"><a name="l00004"></a><span class="lineno"><a class="line" href="_full__plane_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">    4</a></span>&#160;<span class="preprocessor">#define epsilon 0.000001</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="class_full__plane.html#adc74c83d8c266176e717e54aff561a63">    7</a></span>&#160;<a class="code" href="class_full__plane.html#adc74c83d8c266176e717e54aff561a63">Full_plane::Full_plane</a>(<a class="code" href="classplane.html">plane</a> p, std::vector&lt;vertex_3d&gt; v3d_list, std::vector&lt;edge_3d&gt; e3d_list)</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;{</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    this-&gt;p.<a class="code" href="classplane.html#a93c319b577955eca012b2866db926c1f">a</a> = p.<a class="code" href="classplane.html#a93c319b577955eca012b2866db926c1f">a</a>;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    this-&gt;p.<a class="code" href="classplane.html#af4a97d4328067448317dd787e048bc70">b</a> = p.<a class="code" href="classplane.html#af4a97d4328067448317dd787e048bc70">b</a>;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    this-&gt;p.<a class="code" href="classplane.html#a3024e149a5b2cb4697fa71ae7d539bd1">c</a> = p.<a class="code" href="classplane.html#a3024e149a5b2cb4697fa71ae7d539bd1">c</a>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;    this-&gt;p.<a class="code" href="classplane.html#a9a3cb65698785bad8199e7afbd083e27">d</a> = p.<a class="code" href="classplane.html#a9a3cb65698785bad8199e7afbd083e27">d</a>;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <a class="code" href="class_full__plane.html#a02b7ba0ae30cc09e077ac6d4b46a2db2">add_vertices</a>(v3d_list);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <a class="code" href="class_full__plane.html#a155473c38443048865b1be6346cd011e">add_edges</a>(e3d_list,v3d_list);</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;}</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_full__plane.html#a2dc5c95254d2537c62f6616418f53b6b">   20</a></span>&#160;<a class="code" href="class_full__plane.html#adc74c83d8c266176e717e54aff561a63">Full_plane::Full_plane</a>(<a class="code" href="classplane.html">plane</a> <a class="code" href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">p</a>)</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    std::vector&lt;vertex_3d&gt; v1;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    std::vector&lt;edge_3d&gt; e1;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="class_full__plane.html#adc74c83d8c266176e717e54aff561a63">Full_plane</a>(p,v1,e1);</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;}</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">   27</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">Full_plane :: v_on_this_plane</a>(<a class="code" href="classvertex__3d.html">vertex_3d</a> v)</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;{</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <a class="code" href="classvertex__3d.html">vertex_3d</a> v1(<a class="code" href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">p</a>.<a class="code" href="classplane.html#a93c319b577955eca012b2866db926c1f">a</a>,<a class="code" href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">p</a>.<a class="code" href="classplane.html#af4a97d4328067448317dd787e048bc70">b</a>,<a class="code" href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">p</a>.<a class="code" href="classplane.html#a3024e149a5b2cb4697fa71ae7d539bd1">c</a>);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keywordtype">float</span> ans = <a class="code" href="general__methods_8h.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a>(v,v1);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    ans -= <a class="code" href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">p</a>.<a class="code" href="classplane.html#a9a3cb65698785bad8199e7afbd083e27">d</a>;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    ans = std::abs(ans);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">if</span>(ans &lt; <a class="code" href="_full__plane_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">epsilon</a>) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;}</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="class_full__plane.html#a3bcb8b532890ad5b4abc7ed270b039de">   37</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_full__plane.html#a3bcb8b532890ad5b4abc7ed270b039de">Full_plane :: e_on_this_plane</a>(<a class="code" href="classvertex__3d.html">vertex_3d</a> v1,<a class="code" href="classvertex__3d.html">vertex_3d</a> v2)</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;{</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keywordflow">if</span>(<a class="code" href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">v_on_this_plane</a>(v1) &amp;&amp; <a class="code" href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">v_on_this_plane</a>(v2))</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;}</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="class_full__plane.html#a02b7ba0ae30cc09e077ac6d4b46a2db2">   44</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_full__plane.html#a02b7ba0ae30cc09e077ac6d4b46a2db2">Full_plane :: add_vertices</a>(std::vector&lt;vertex_3d&gt; v3d_list)</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;{</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;(int)v3d_list.size();i++)</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    {</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordtype">bool</span> check = <a class="code" href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">v_on_this_plane</a>(v3d_list[i]);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordflow">if</span>(check==<span class="keyword">true</span>)</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            <a class="code" href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">vertices_on_it</a>.push_back(i);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    }</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="class_full__plane.html#a155473c38443048865b1be6346cd011e">   54</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_full__plane.html#a155473c38443048865b1be6346cd011e">Full_plane :: add_edges</a>(std::vector&lt;edge_3d&gt; e3d_list, std::vector&lt;vertex_3d&gt; v3d_list)</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;{</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keywordflow">for</span>(<span class="keyword">auto</span> zz : e3d_list)</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    {</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="keywordtype">bool</span> check = <a class="code" href="class_full__plane.html#a3bcb8b532890ad5b4abc7ed270b039de">e_on_this_plane</a>(v3d_list[zz.f],v3d_list[zz.s]);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <span class="keywordflow">if</span>(check==<span class="keyword">true</span>)</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <a class="code" href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">edges_on_it</a>.push_back(zz);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    }</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;}</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="ttc" id="_full__plane_8cpp_html_a06b50f1ca7258a9862c39d3ed354bf7c"><div class="ttname"><a href="_full__plane_8cpp.html#a06b50f1ca7258a9862c39d3ed354bf7c">epsilon</a></div><div class="ttdeci">#define epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00004">Full_plane.cpp:4</a></div></div>
<div class="ttc" id="class_full__plane_html_a02b7ba0ae30cc09e077ac6d4b46a2db2"><div class="ttname"><a href="class_full__plane.html#a02b7ba0ae30cc09e077ac6d4b46a2db2">Full_plane::add_vertices</a></div><div class="ttdeci">void add_vertices(std::vector&lt; vertex_3d &gt; v3d_list)</div><div class="ttdoc">function to add the vertices which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00044">Full_plane.cpp:44</a></div></div>
<div class="ttc" id="classvertex__3d_html"><div class="ttname"><a href="classvertex__3d.html">vertex_3d</a></div><div class="ttdoc">class for a vertex_3d </div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00064">structs.h:64</a></div></div>
<div class="ttc" id="classplane_html_af4a97d4328067448317dd787e048bc70"><div class="ttname"><a href="classplane.html#af4a97d4328067448317dd787e048bc70">plane::b</a></div><div class="ttdeci">float b</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00116">structs.h:116</a></div></div>
<div class="ttc" id="class_full__plane_html_ad65bd61131d3c78d146592919a43fc3e"><div class="ttname"><a href="class_full__plane.html#ad65bd61131d3c78d146592919a43fc3e">Full_plane::p</a></div><div class="ttdeci">plane p</div><div class="ttdoc">equation of plane i.e (a,b,c,d) for ax + by + cz + d = 0 </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00016">Full_plane.h:16</a></div></div>
<div class="ttc" id="class_full__plane_html_ad46ab0d796a3bfc10e7e8f4c2fa85bfc"><div class="ttname"><a href="class_full__plane.html#ad46ab0d796a3bfc10e7e8f4c2fa85bfc">Full_plane::v_on_this_plane</a></div><div class="ttdeci">bool v_on_this_plane(vertex_3d v)</div><div class="ttdoc">function to check if the vertex v is on this plane or not </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00027">Full_plane.cpp:27</a></div></div>
<div class="ttc" id="classplane_html_a93c319b577955eca012b2866db926c1f"><div class="ttname"><a href="classplane.html#a93c319b577955eca012b2866db926c1f">plane::a</a></div><div class="ttdeci">float a</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00115">structs.h:115</a></div></div>
<div class="ttc" id="class_full__plane_html_a3bcb8b532890ad5b4abc7ed270b039de"><div class="ttname"><a href="class_full__plane.html#a3bcb8b532890ad5b4abc7ed270b039de">Full_plane::e_on_this_plane</a></div><div class="ttdeci">bool e_on_this_plane(vertex_3d v1, vertex_3d v2)</div><div class="ttdoc">function to check if the edge e is on this plane or not </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00037">Full_plane.cpp:37</a></div></div>
<div class="ttc" id="class_full__plane_html_a0b93d1b5a72f3fb83808edfce3bbcd1b"><div class="ttname"><a href="class_full__plane.html#a0b93d1b5a72f3fb83808edfce3bbcd1b">Full_plane::vertices_on_it</a></div><div class="ttdeci">std::vector&lt; int &gt; vertices_on_it</div><div class="ttdoc">vector of enum of vertices which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00018">Full_plane.h:18</a></div></div>
<div class="ttc" id="classplane_html"><div class="ttname"><a href="classplane.html">plane</a></div><div class="ttdoc">class for a plane plane represented as (a,b,c,d) corresponding to the equation ax + by + cz = d ...</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00113">structs.h:113</a></div></div>
<div class="ttc" id="classplane_html_a9a3cb65698785bad8199e7afbd083e27"><div class="ttname"><a href="classplane.html#a9a3cb65698785bad8199e7afbd083e27">plane::d</a></div><div class="ttdeci">float d</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00118">structs.h:118</a></div></div>
<div class="ttc" id="general__methods_8h_html"><div class="ttname"><a href="general__methods_8h.html">general_methods.h</a></div></div>
<div class="ttc" id="class_full__plane_html_adc74c83d8c266176e717e54aff561a63"><div class="ttname"><a href="class_full__plane.html#adc74c83d8c266176e717e54aff561a63">Full_plane::Full_plane</a></div><div class="ttdeci">Full_plane(plane p, std::vector&lt; vertex_3d &gt; v3d_list, std::vector&lt; edge_3d &gt; e3d_list)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00007">Full_plane.cpp:7</a></div></div>
<div class="ttc" id="class_full__plane_html_a88e6924e5ae6ef5ed92611ff849be290"><div class="ttname"><a href="class_full__plane.html#a88e6924e5ae6ef5ed92611ff849be290">Full_plane::edges_on_it</a></div><div class="ttdeci">std::vector&lt; edge_3d &gt; edges_on_it</div><div class="ttdoc">vector of edges which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8h_source.html#l00020">Full_plane.h:20</a></div></div>
<div class="ttc" id="class_full__plane_html_a155473c38443048865b1be6346cd011e"><div class="ttname"><a href="class_full__plane.html#a155473c38443048865b1be6346cd011e">Full_plane::add_edges</a></div><div class="ttdeci">void add_edges(std::vector&lt; edge_3d &gt; e3d_list, std::vector&lt; vertex_3d &gt; v3d_list)</div><div class="ttdoc">function to add the edges which are on this plane </div><div class="ttdef"><b>Definition:</b> <a href="_full__plane_8cpp_source.html#l00054">Full_plane.cpp:54</a></div></div>
<div class="ttc" id="classplane_html_a3024e149a5b2cb4697fa71ae7d539bd1"><div class="ttname"><a href="classplane.html#a3024e149a5b2cb4697fa71ae7d539bd1">plane::c</a></div><div class="ttdeci">float c</div><div class="ttdef"><b>Definition:</b> <a href="structs_8h_source.html#l00117">structs.h:117</a></div></div>
<div class="ttc" id="general__methods_8h_html_adde63ba9542357791cc6a967f2ea582e"><div class="ttname"><a href="general__methods_8h.html#adde63ba9542357791cc6a967f2ea582e">dot_product</a></div><div class="ttdeci">float dot_product(vertex_3d a, vertex_3d b)</div><div class="ttdef"><b>Definition:</b> <a href="general__methods_8cpp_source.html#l00017">general_methods.cpp:17</a></div></div>
<div class="ttc" id="_full__plane_8h_html"><div class="ttname"><a href="_full__plane_8h.html">Full_plane.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
